package com.ytf.test.ninth.interfaces;

interface CanFight{
    void fight();
}
interface CanSwim{
    void swim();
}
interface CanFly{
    void fly();
}
class ActionCharacter {
    public void fight(){
        System.out.println("ActionCharacter.fight()");
    }
}
class Hero extends ActionCharacter implements CanFight,CanSwim,CanFly {

    @Override
    public void swim() {
        System.out.println("Hero.swim()");
    }

    @Override
    public void fly() {
        System.out.println("Hero.fly()");
    }

    // @Override
    // public void fight() {
    //     System.out.println("Hero.fight()");
    // }
}
/**
 * @author: YTF
 * @date: 2025/1/26 10:27
 * @version: 1.0
 * @description:
 */
public class Adventure {
    public static void canFi(CanFight canFight) {
        canFight.fight();
    }
    public static void canSw(CanSwim canSwim){
        canSwim.swim();
    }
    public static void canFl(CanFly canFly){
        canFly.fly();
    }
    public static void actC(ActionCharacter actionCharacter){
        actionCharacter.fight();
    }
    public static void main(String[] args) {
        Hero hero = new Hero();
        canFi(hero);
        canSw(hero);
        canFl(hero);
        actC(hero);
        /**
         * OutPut:
         * ActionCharacter.fight()
         * Hero.swim()
         * Hero.fly()
         * ActionCharacter.fight()
         */
    }
}
